package com.tebiecloud.base.server.mapper;

import com.tebiecloud.base.client.model.AuthorityResource;
import com.tebiecloud.base.client.model.entity.BaseAuthority;
import com.tebiecloud.common.mybatis.base.mapper.SuperMapper;
import com.tebiecloud.common.security.SecurityAuthority;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 系统权限-菜单权限、操作权限、API权限 Mapper 接口
 * @author tebie
 * @date 2019-08-08
 */
@Repository
public interface BaseAuthorityMapper extends SuperMapper<BaseAuthority> {

    /**
     * 查询已授权权限列表
     * @param status 状态
     * @param type 类型 -1全部 1获取菜单和操作 2获取API
     * @return
     */
    List<SecurityAuthority> selectAuthority(@Param("status") int status, @Param("type") int type);

    /**
     * 查询所有资源授权列表
     * @return
     */
    List<AuthorityResource> selectAllAuthorityResource();

}
